package com.xuetang9.t9.hotel.utils;



import org.apache.commons.lang3.time.FastDateFormat;
import org.springframework.core.convert.converter.Converter;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 类型转换器
 * @author pang
 */
public class StringToDateConverter implements Converter<String, Date>{
    @Override
    public Date convert(String s) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date date = null;
        try {
            date = simpleDateFormat.parse(s);
        }catch (Exception e){
            e.printStackTrace();
        }
        return date;
    }
}
